#include <csignal>
#include <unistd.h>
#include <fmt/core.h>

void handlerSig(int sig)
{
    fmt::print("获得了一个信号: {}\n", sig);
    // exit(13);
}

int main()
{
    for (int i = 0; i < 32; i++)
        signal(i, handlerSig);
    signal(SIGINT, handlerSig);
    int cnt = 0;
    while (true)
    {
        fmt::print("hello world, {}, pid: {}\n", cnt++, getpid());
        sleep(1);
        int a = 10;
        int *p = nullptr;
        *p = 100;
    }
    return 0;
}
